Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not deploy jobs pod when using local eventbus #175

Conversation

jsirianni
Copy link
Member

@jsirianni jsirianni commented Oct 23, 2024

Description of Changes

When eventbus.type: "" (local), we should not deploy the jobs pod. We should also deploy the BindPlane pod with mode all.

It was assumed if "deployment type" was Deployment, that an event bus would be used for BindPlane HA. This is not the case. It is possible users would implement Postgres while sticking with local event bus (limited to one pod).

Deploying the jobs pod, and using mode "node" without an event bus will cause rollouts to fail.

Testing

Create values.yaml with the following.

config:
  username: bpuser
  password: bppass
  sessions_secret: 4484766F-5016-4077-B8E0-0DE1D637854B
  licenseUseSecret: true

backend:
  type: postgres
  postgres:
    host: postgres.postgres.svc.cluster.local
    database: bindplane
    username: postgres
    password: password
    maxConnections: 20

resources:
  requests:
    memory: 100Mi
    cpu: 100m
  limits:
    memory: 100Mi

Start minikube

minikube start

Deploy your license key

kubectl create secret generic bindplane \
  --from-literal=license=$BINDPLANE_LICENSE

Deploy Postgres

kubectl apply -f test/helper/postgres/postgres.yaml

Deploy the chart

helm upgrade \
  --install bindplane \
  ./charts/bindplane \
  --values values.yaml

You should see the following in the default namespace:

NAME                                            READY   STATUS    RESTARTS   AGE
bindplane-756cf87b5b-z6m9f                   1/1     Running   0          18m
bindplane-prometheus-0                       1/1     Running   0          32m
bindplane-transform-agent-5b87554f58-nlf2d   1/1     Running   0          32m

The BINDPLANE_MODE should be set to all.

kubectl get deploy bindplane -o json | \
  jq '.spec.template.spec.containers[0].env[] | select(.name=="BINDPLANE_MODE") | .value'

You can upgrade to a NATS environment if using an Enterprise license. Modify the values file.

eventbus:
  type: nats

Redeploy:

helm upgrade \
  --install bindplane \
  ./charts/bindplane \
  --values values.yaml

This time, you should see the NATS pods, a jobs pod, and the deployment will have mode: node.

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CI passes
  • Changes to ports, services, or other networking have been tested with istio

{{- if eq (include "bindplane.deployment_type" .) "Deployment" }}
{{- if ne .Values.eventbus.type "" }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If eventbus is not set, skip the jobs pod deployment.

{{- if eq (include "bindplane.deployment_type" .) "StatefulSet" }}
{{- if eq .Values.eventbus.type "" }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If event bus is not set, set mode to all.

"type": {
"type": "string",
"enum": ["", "nats", "pubsub", "kafka"],
"description": "The type of event bus used. Must be one of '', 'nats', 'pubsub', or 'kafka'."
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will ensure users only configure eventbus.type with the following values

  • ""
  • "nats"
  • "postgres"
  • "kafka"

Kafka is deprecated, and omitted from docs but should still be supported by the chart.

@jsirianni jsirianni marked this pull request as ready for review October 23, 2024 11:57
@jsirianni jsirianni requested a review from tbm48813 as a code owner October 23, 2024 11:57
@jsirianni jsirianni merged commit e709aea into main Oct 25, 2024
19 checks passed
@jsirianni jsirianni deleted the joesirianni/bpop-1025-bindplane-helm-support-postgres-local-event-bus branch October 25, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants